Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new database Table and schema for wf_requests #1932

Merged

Conversation

aliraza556
Copy link
Contributor

Describe the changes:

  • To track and manage workflow requests in the Stakwork infrastructure.
  • Add new database table and schema for wf_requests

closes: #1925

Issue ticket number and link:

  • Ticket Number: [ 1925 ]
  • Link: [ https://github.com/stakwork/sphinx-tribes-frontend/issues/1925]

Evidence:

https://www.loom.com/share/468858d24fdf4421a435f0e27479d228

image

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome
  • New feature (non-breaking change which adds functionality)
  • I have provided a screenshot of changes in my PR

db/structs.go Outdated
type WfRequest struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
RequestID string `gorm:"unique;not null" json:"request_id"`
Status string `json:"status"`
Copy link
Contributor

@tobi-bams tobi-bams Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aliraza556 please can you make Status an enum of NEW,PENDING, COMPLETED or FAILED

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobi-bams, added

db/structs.go Outdated
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
RequestID string `gorm:"unique;not null" json:"request_id"`
Status string `json:"status"`
RequestData JSONB `json:"request_data"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is there a reason why you are not using gorm for RequestData?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobi-bams address

@aliraza556 aliraza556 requested a review from tobi-bams November 11, 2024 12:11
@aliraza556
Copy link
Contributor Author

Hi @tobi-bams, Please review this PR.

type WfRequestStatus string

const (
StatusNew WfRequestStatus = "NEW"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aliraza556 I don't think NEW is a status.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elraphty, for now NEW is a valid state this will be the default state before we send to stakwork. When stakwork sends back a project_id then we can update it to PENDING. I and @humansinstitute agreed to this, but if you have a better status name that will be nice we just came up with that on the fly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Okay bro, will merge now.

@elraphty elraphty merged commit 92d3fa2 into stakwork:master Nov 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New database table and schema for wf_requests
3 participants